<taglib name="html" />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
 <HEAD>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <TITLE>ThinkPHP示例：CURD操作</TITLE>
<link rel='stylesheet' type='text/css' href='__PUBLIC__/Css/common.css'>
<html:import type="js" file="Js.Base" /> 
<html:import type="js" file="Js.prototype" /> 
<html:import type="js" file="Js.mootools" /> 
<html:import type="js" file="Js.Ajax.ThinkAjax" /> 
<html:import type="js" file="Js.Form.CheckForm" /> 
 </HEAD>
 <BODY><SCRIPT LANGUAGE="JavaScript">
 <!--
	function add(){
		window.location.href="__URL__/add";
	}
	function edit(id){
		window.location.href="__URL__/edit/id/"+id;
	}
	function del(id){
		ThinkAjax.send('__URL__/delete','ajax=1&id='+id,complete,'result');
	}
	function complete(data,status){
		if (status==1)
		{
			$('div_'+data).outerHTML = '';
		}
	}
 //-->
 </SCRIPT>
 <div class="main">
 <H2>ThinkPHP示例之：CURD操作</H2>
方便地完成对单表的CURD操作<P>

 <TABLE cellpadding=2 cellspacing=2>
  <TR>
	<TD colspan="2"><INPUT TYPE="button" value="新 增" class="small button" onclick="add()"><div id="result" class="none result" style="font-family:微软雅黑,Tahoma;letter-spacing:2px"></div></TD>
 </TR>
  <TR>
  <TD></TD>
	<TD > <div id="list" >
	<volist name="list" id="vo"><div id="div_{$vo.id}" class="result" style='font-weight:normal;<eq name="odd" value="1">background:#ECECFF</eq>'><div style="border-bottom:1px dotted silver">{$vo.title}  [{$vo.email} {$vo.create_time|date='Y-m-d H:i:s',###}] <BR><INPUT TYPE="button" value="编辑" class="small button" onclick="edit({$vo.id})"> <INPUT TYPE="button" value="删除" class="small button" onclick="del({$vo.id})"> </div>
	<div class="content">{$vo.content|nl2br}</div></div>
	</volist></div></TD>
  </TR>
 <TR>
 <TD></TD>
	<TD ><HR> 示例源码<BR>控制器IndexAction类<BR><php>highlight_file(LIB_PATH.'Action/IndexAction.class.php');</php><BR>模型FormModel类<BR><php>highlight_file(LIB_PATH.'Model/FormModel.class.php');</php></TD>
 </TR>
 </TABLE>

</div>
 </BODY>
</HTML>
